﻿@model MobiShop.Models.Order
@using MobiShop.Models

@{
    ViewBag.Title = "Sửa thông tin đơn đặt hàng";
    ViewBag.AddCssFile = "<link href=\"" + Url.Content("~/Content/admin/css/CalendarCss.css") + "\" rel=\"stylesheet\" type=\"text/css\" />";
    Layout = "~/Views/Shared/_AdminStart.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/CalendarScript.js")" type="text/javascript"></script>

@{
    string mPrev_image = Url.Content("~/Content/admin/images/prev.gif");
    string mNext_image = Url.Content("~/Content/admin/images/next.gif");
}
<script type="text/javascript">
    mPrev_image = "@mPrev_image";
    mNext_image = "@mNext_image";
</script>
<div id="calendarDiv" class="calendarDiv"></div>


<div class="titleForm">
    <h3>Sửa thông tin đơn đặt hàng</h3>
</div>

<div>
    <div class="boxCreateLeft"></div>
    <div class="boxtCreateCenter" style="width:800px;" >

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <input type="hidden" id="SaveReturnUrl" name="SaveReturnUrl" value="@ViewBag.ReturnUrl" />
    <input type="hidden" id="creditCardNumber" name="creditCardNumber" value="9999XXXXXXXXXXXX" />
    <input type="hidden" id="cardCVV" name="cardCVV" value="XXX" />
    
    <fieldset>
        <legend>Thông tin đơn đặt hàng</legend>
        @Html.HiddenFor(model => model.id)

        <table>
            <tr>
                <td style="width:100px;">
                    Mã tài khoản:
                </td>
                <td>
                    @Model.customerId
                </td>
            </tr>
            <tr>
                <td>
                    Tên tài khoản: 
                </td>
                <td>
                    @Model.Account.username
                </td>
            </tr>
            <tr>
                <td>
                    Ngày đặt hàng:
                </td>
                <td>
                    @Model.orderDate
                </td>
            </tr>
            <tr>
                <td>
                    Tổng giá trị:
                </td>
                <td>
                    @String.Format("{0:0,0}", Model.totalPayment) Vnđ
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.receiveName)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.receiveName, new { style = "width:200px;" })
                    @Html.ValidationMessageFor(model => model.receiveName)
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.receiveAddress)
                </td>
                <td>
                    @Html.TextAreaFor(model => model.receiveAddress, new { cols = "50", rows = "3" })
                    @Html.ValidationMessageFor(model => model.receiveAddress)
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.receivePhoneNumber)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.receivePhoneNumber, new { style = "width:100px;" })
                    @Html.ValidationMessageFor(model => model.receivePhoneNumber)
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.receiveIdentityCardNumber)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.receiveIdentityCardNumber, new { style = "width:100px;" })
                    @Html.ValidationMessageFor(model => model.receiveIdentityCardNumber)
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.orderStatusId) 
                </td>
                <td>
                    @Html.DropDownListFor(model => model.orderStatusId, (SelectList)ViewBag.orderStatusList, "Chọn trạng thái") 
                    @Html.ValidationMessageFor(model => model.orderStatusId)
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.receiveDate)
                </td>
                <td>
                    @Html.EditorFor(model => model.receiveDate, new { style = "width:100px;" })
                    <input type="button" value="" style="width:25px;"  _textboxid="receiveDate" />
                    @Html.ValidationMessageFor(model => model.receiveDate)
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(model => model.visible)
                </td>
                <td>
                    @Html.DropDownListFor(model => model.visible, (List<SelectListItem>)ViewBag.VisibleList) 
                    @Html.ValidationMessageFor(model => model.visible)
                </td>
            </tr>
            <tr>
                <td>
                    
                </td>
                <td>
                    <input type="submit" value="Save" />
                    <span style="color:Red; font-style:italic;">@ViewBag.ThongBao</span>
                </td>
            </tr>
        </table>
    </fieldset>
}
</div>
    <div class="boxCreateRight"></div>
</div>


<div class="linkCommand">
    <a href="@ViewBag.ReturnUrl">Trở về</a>
</div>


<script type="text/javascript">
    $(document).ready(function (e) {
        $("#receiveDate").css("width", "90px");
    });
</script>